#include<iostream>
#include <string>
#include<vector>

using namespace std;
//电话号码的字母组合
class Solution {
public:
    vector<string> letterCombinations(string digits) {
           vector<string> vs;
        if(digits=="")
            return vs;
        string str[10] ={" "," ","abc","def","ghi","jkl","mno","pqrs","tuv","wxyz"};
        // 初始化结果数组
        vs.push_back("");


        for(int i=0;i<digits.size();i++)
        {
           int num = digits[i]-'0';
           vector<string> tmp;
           for(int j=0;j<vs.size();j++)
           {
            for(int k=0;k<str[num].size();k++)
            {
                tmp.push_back(vs[j]+str[num][k]);
            }
           }
           vs=tmp;
        }

        return vs;
    
    }
};
